The function calculates the distance between two points in the plane.
| LGF_CalcDistance_2D (FC) | ||||||||
|---|---|---|---|---|---|---|---|---|
| LReal | x1 | Ret_Val | LReal | |||||
| LReal | y1 | |||||||
| LReal | x2 | |||||||
| LReal | y2 | |||||||
| Identifier | Data type | Description |
|---|---|---|
| x1 | LReal | X coordinate point 1 |
| y1 | LReal | Y coordinate point 1 |
| x2 | LReal | X coordinate point 2 |
| y2 | LReal | Y coordinate point 2 |
| Identifier | Data type | Description |
|---|---|---|
| Ret_Val | LReal | Calculated distance between the Points |
The block calculates the distance between two points in a Cartesian coordinate system. The distance is calculated with the following formula:
result = \sqrt[2]{(x_2-x_1)^2+(y_2-y_1)^2}Figure: Graphical representation
| Version & Date | Change description | |
|---|---|---|
| 01.00.00 | Siemens Industry Online Support | |
| 06.07.2018 | First released version | |
| 01.00.01 | Siemens Industry Online Support | |
| 17.08.2018 | Upgrade: TIA V15 Update 2 | |
| 01.00.02 | Siemens Industry Online Support | |
| 23.11.2018 | Upgrade: TIA V15.1 | |
| 01.02.00 | Simatic Systems Support | |
| 04.10.2019 | renamed from "Distance" to "CalcDistance_2D" Data type changed to LREAL Data type changed to LREAL | |
| 03.00.00 | Simatic Systems Support | |
| 23.04.2020 | Set version to V3.0.0, harmonize the version of the whole library | |
| 03.00.01 | Simatic Systems Support | |
| 12.11.2020 | Insert documentation | |